home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 5.5 KB | 146 lines | [TEXT/MPS ] |
- /*
- File: SampleAgent.r
-
- Contains: Resources for the SampleAgent Library
-
- Copyright: © 1991-1992 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef __TYPES.R__
- #include "Types.r"
- #endif
-
- #include "SNMPVersionResource.r"
-
- #ifndef __SNMPTypes.r__
- #include "SNMPTypes.r"
- #endif
-
- INCLUDE "SampleAgent.RSRC" 'libr' (0) as 'libr' (0);
- INCLUDE "SampleAgent.RSRC" 'code' as 'code';
-
- // some defines for portions of object ids
-
- #define kNameRsrcID 3000
- #define kDescRsrcID 3001
- #define SAMPLE kOID_ISO, kOID_ORG, kOID_DOD, kOID_INTERNET, kOID_PRIVAT, kOID_ENTERPRISES, kOID_APPLE, kOID_APPL_EXPERIMENTAL, 1
- #define DIRECT SAMPLE, 1
- #define INDIRECT SAMPLE, 2
-
-
- //--------------------------------------------------------------------------------------------------
- // Variable Description resource
- //--------------------------------------------------------------------------------------------------
-
- resource 'vard' (128, "Sample Agent Variable Description Resource", purgeable)
- {
- kNameRsrcID, // name strings resource id
- kDescRsrcID, // description strings resource id
- 1, // agents name and desc string index
-
- // string index and object ids of all groups to be registered
- {
- 2, {DIRECT}, // direct group
- 3, {INDIRECT}, // indirect group
- },
-
- // string index, ASN type, access, callback proc index, and object id for all
- // variables
-
- {
- 4, kSNMP_Integer, kSNMP_ReadWrite, 0, 0, 0, {INDIRECT, 1}, // IndIntRW
- 5, kSNMP_Integer, kSNMP_ReadOnly, 0, 1, 0, {INDIRECT, 2}, // IndIntR
- 6, kSNMP_SequenceOF, kSNMP_NoAccess, 0, 2, 0, {INDIRECT, 3}, // Table1
- 7, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 3, 0, {INDIRECT, 3, 1, 1}, // T1Int
- 8, kSNMP_OctetStr | kSNMP_TableElement, kSNMP_ReadWrite, 0, 4, 0, {INDIRECT, 3, 1, 2}, // T1Str
- 9, kSNMP_SequenceOF, kSNMP_NoAccess, 0, 5, 0, {INDIRECT, 4} , // Table2
- 10, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 6, 0, {INDIRECT, 4, 1, 1}, // T2Index1
- 11, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 7, 0, {INDIRECT, 4, 1, 2}, // T2Index2
- 12, kSNMP_OctetStr | kSNMP_TableElement, kSNMP_ReadWrite, 0, 8, 0, {INDIRECT, 4, 1, 3}, // T2Str
- 13, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 9, 0, {INDIRECT, 4, 1, 4}, // T2Valid
- 14, kSNMP_Integer, kSNMP_ReadWrite, 4, 0, 1, {DIRECT, 1} // DirInt
- }
- };
-
- //--------------------------------------------------------------------------------------------------
- // Name strings
- //
- // The indexes for each name string must match the indexes given in the 'vard' resource above.
- //--------------------------------------------------------------------------------------------------
-
- resource 'STR#' (kNameRsrcID, "Sample Agent Name strings", purgeable)
- {
- {
- /* [1] */ "Mac Sample Agent",
- /* [2] */ "Direct Group",
- /* [3] */ "Indirect Group",
- /* [4] */ "indIntRW",
- /* [5] */ "indIntR",
- /* [6] */ "table1",
- /* [7] */ "t1Int",
- /* [8] */ "t1Str",
- /* [9] */ "table2",
- /* [10] */ "t2Index1",
- /* [11] */ "t2Index2",
- /* [12] */ "t2Str",
- /* [13] */ "t2Valid",
- /* [14] */ "dirIntRW"
- }
- };
-
-
- //--------------------------------------------------------------------------------------------------
- // Description strings
- //
- // The indexes for the strings here must match the indexes given in the 'vard' resource above.
- //--------------------------------------------------------------------------------------------------
-
- resource 'STR#' (kDescRsrcID, "Sample Agent Description strings", purgeable)
- {
- {
- /* [1] */
- "Sample Agent. This agent is provided for use as an example of how to "
- "build an SNMP agent.",
- /* [2] */
- "The direct group. This group contains the variables which were registered "
- "as direct variables - i.e. the variable object accesses the variable data "
- "directly through a pointer.",
- /* [3] */
- "The Indirect Group. This group contains the variables which were registered "
- "as indirect variables - i.e. the variable object accesses the variable data "
- "indirectly through a function in the agent.",
- /* [4] */
- "An indirect read/write integer. An indirect variable is one in which the variable "
- "object accesses the variable data indirectly through a function in the agent.",
- /* [5] */
- "An Indirect read-only integer. An indirect variable is one in which the variable "
- "object accesses the variable data indirectly through a function in the agent.",
- /* [6] */
- "A table consisting of 2 columns, an integer and a string. Rows are added or deleted "
- "by setting the integer column.",
- /* [7] */
- "The integer column of table1. This column is used to add and delete rows. Setting a "
- "value of zero deletes the row, and setting a value from 1 to 999 adds the row. A "
- "value greater than 999 is invalid.",
- /* [8] */
- "The String column of table 1. A value must be set in this column when adding a row "
- "to the table.",
- /* [9] */
- "A two index table in which the indexes are columns in the table. The valid column "
- "is used to create and delete rows.",
- /* [10] */
- "The first Index column of table 2. The value can range from 1 to 10.",
- /* [11] */
- "The second Index column of table 2. The value can range from 1 to 10.",
- /* [12] */
- "The string column of table 2. If not set when adding a row, a null string will be "
- "set by default.",
- /* [13] */
- "The valid column of table 2. Setting it to zero deletes the row, and setting it "
- "to non-zero adds the row.",
- /* [14] */
- "A Direct Read/Write integer. A direct variable is one in which the variable object "
- "accesses the variable data directly."
- }
- };